In [20]:
import numpy as np
b = np.array([(1,2), (2, 1)])
print(b)
print()
print(2*b)
print()
print(b*b)
print()
print(b**2)
print()
print(1/b) # Warning!
In [21]:
a = np.array([1, 2, 3])
b = np.array([2, 3, 4])
a * b, a.dot(b)
Out[21]:
In [29]:
A = np.matrix([
[1, 2],
[2, 1]
])
w, v = np.linalg.eig(A)
print(w) # Eigenvalues
print(v) # Eingenvector
A
Out[29]:
In [4]:
import pandas as pd
In [5]:
df = pd.read_csv("./auxFiles/pandasExample.csv")
In [6]:
df.head()
Out[6]:
In [7]:
df.shape
Out[7]:
In [8]:
df.columns
Out[8]:
In [9]:
df.dtypes
Out[9]:
In [10]:
xDf = df['x']
yDf = df['y']
In [67]:
import matplotlib.pyplot as plt
%matplotlib inline
rcParams["figure.figsize"] = [12.0, 6.0]
In [68]:
x = numpy.linspace(0, 2*numpy.pi, 50)
y1 = numpy.sin(x)
y2 = numpy.sin(2*x)
plot(x, y1)
Out[68]:
In [69]:
plot(x, y1, x, y2)
Out[69]:
In [70]:
scatter(x, y1)
Out[70]:
In [71]:
hist(rand(1000), 10);
In [72]:
yerror = rand(50)
errorbar(x, y1, yerror)
Out[72]:
In [73]:
data = rand(100)
boxplot(data);
In [74]:
import matplotlib.image as image
img = image.imread('./auxFiles/logo.png')
imshow(img)
Out[74]:
In [99]:
from IPython.display import HTML
HTML('<iframe src=http://www.unimelb.edu.au width=700 height=350></iframe>')
Out[99]:
In [ ]:
from IPython.display import Image
Image("./auxFiles/logo.png")
In [ ]:
from IPython.display import YouTubeVideo
YouTubeVideo('HW29067qVWk')
In [100]:
# %load https://matplotlib.org/_downloads/unicode_minus.py
In [109]:
?
In [ ]:
%time